package com.ficus.road.maintain.strategy.operationlog;

import com.alibaba.fastjson.JSONArray;
import com.ficus.road.maintain.core.model.Hit;
import com.ficus.road.maintain.core.model.OperationLog;
import org.apache.commons.lang3.ObjectUtils;

/**
 * @author xiawen yang
 * @date 2021/12/24 上午11:16
 */
public class PushCJYHStrategy implements OperationLogStrategy {
    @Override
    public Object processRequestParam(String jsonString) {
        Hit hit = new Hit();
        JSONArray jsonArray = JSONArray.parseArray(jsonString);
        if (ObjectUtils.isNotEmpty(jsonArray)) {
            hit = jsonArray.getObject(0, Hit.class);
        }
        return hit;
    }

    // 不处理
    @Override
    public Object processResponse(String returnString, OperationLog operationLog) {
        return returnString;
    }

}
